import request from '@/utils/request'

/**
 * @description 获取员工列表
 * @param {*} params
 * @returns
 */
export const getEmployeesListApi = (params) => request({
  url: '/sys/user',
  params
})

/**
 * @description 根据id删除员工
 * @param {*} id
 * @returns
 */
export const delEmployessApi = (id) => request({
  url: `/sys/user/${id}`,
  method: 'DELETE'
})

/**
 * @description 新增员工
 * @param {*} data
 * @returns
 */
export const addEmployessApi = (data) => request({
  url: '/sys/user',
  method: 'POST',
  data
})

/**
 * @description 批量导入员工
 * @param {*} data
 * @returns
 */
export const batchEmployListApi = (data) => request({
  url: '/sys/user/batch',
  method: 'POST',
  data
})

/**
 * @description 保存员工基本信息
 * @param {*} data
 * @returns
 */
export const saveEmployInfoApi = (data) => request({
  url: `/sys/user/${data.id}`,
  method: 'PUT',
  data
})

/**
 * @description 给员工分配角色
 * @param {*} data
 * @returns
 */
export const setUserRoleApi = (data) => request({
  url: '/sys/user/assignRoles',
  method: 'PUT',
  data
})
